<div class="form-group">
    <label class="col-sm-2 control-label">排序</label>
    <div class="col-sm-8">
        <input type="text" class="form-control" name="display_sort" placeholder="排序" value="{model:safe_show field='display_sort' /}" >
        <p class="help-block">数字越大，排名越靠前,如果为空，默认排序方式为创建时间</p>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label must">商品名称</label>
    <div class="col-sm-6">
        <input type="text" class="form-control" name="goods_name" placeholder="商品名称" value="{model:safe_show field='goods_name' /}">
    </div>
    <div class="col-sm-2">
        <input type="text" class="form-control" name="unit" placeholder="商品单位：如个、件、包" value="{model:safe_show field='unit' /}">
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label must">商品类型</label>
    <div class="col-sm-10">
        {volist name="goodsType" id="v"}
        <div class="pretty p-default p-round">
            {if(empty($model))}
            <input type="radio" name="type" class="minimal" value="{$key}" {if(1 == $key)}checked{/if}>
            {else /}
            <input type="radio" name="type" class="minimal" value="{$key}" {if($model['type'] == $key)}checked{/if}>
            {/if}
            <div class="state p-info-o">
                <label>{$v}</label>
            </div>
        </div>
        {/volist}
        <p class="help-block">商品类型，商品保存后无法修改，请谨慎选择</p>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label must">商品属性</label>
    <div class="col-sm-10">
        <div class="pretty p-default">
            <input type="checkbox" name="is_recommand" class="minimal" value="1" {if(!empty($model) && $model['is_recommand'] == 1)}checked{/if}>
            <div class="state p-info-o">
                <label>推荐</label>
            </div>
        </div>
        <div class="pretty p-default">
            <input type="checkbox" name="is_new" class="minimal" value="1" {if(!empty($model) && $model['is_new'] == 1)}checked{/if}>
            <div class="state p-info-o">
                <label>新品</label>
            </div>
        </div>
        <div class="pretty p-default">
            <input type="checkbox" name="is_hot" class="minimal" value="1" {if(!empty($model) && $model['is_hot'] == 1)}checked{/if}>
            <div class="state p-info-o">
                <label>热销</label>
            </div>
        </div>
        <p class="help-block">推荐：在首页显示；</p>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">商品分类</label>
    <div class="col-sm-8">
        <select class="form-control select2-multiple" name="cates[]" multiple="multiple">
            {if(!empty($cates))}
            {volist name="goodsCategorys" id="v"}
            <option value="{$v['id']}" {if(in_array($v['id'],$cates))}selected{/if}>{$v['cat_name']}</option>
            {if(!empty($v['child']))}{volist name="$v['child']" id="vv"}
            <option value="{$vv['id']}" {if(in_array($vv['id'],$cates))}selected{/if}>{$v['cat_name']} - {$vv['cat_name']}</option>
            {if(!empty($vv['child']))}{volist name="$vv['child']" id="vvv"}
            <option value="{$vvv['id']}" {if(in_array($vvv['id'],$cates))}selected{/if}>{$v['cat_name']} - {$vv['cat_name']} - {$vvv['cat_name']}</option>
            {if(!empty($vvv['child']))}{volist name="$vvv['child']" id="vvvv"}
            <option value="{$vvvv['id']}" {if(in_array($vvvv['id'],$cates))}selected{/if}>{$v['cat_name']} - {$vv['cat_name']} - {$vvv['cat_name']} - {$vvvv['cat_name']}</option>

            {/volist}{/if}
            {/volist}{/if}
            {/volist}{/if}
            {/volist}
            {else /}
            {volist name="goodsCategorys" id="v"}
            <option value="{$v['id']}">{$v['cat_name']}</option>
            {if(!empty($v['child']))}{volist name="$v['child']" id="vv"}
            <option value="{$vv['id']}">{$v['cat_name']} - {$vv['cat_name']}</option>
            {if(!empty($vv['child']))}{volist name="$vv['child']" id="vvv"}
            <option value="{$vvv['id']}">{$v['cat_name']} - {$vv['cat_name']} - {$vvv['cat_name']}</option>
            {if(!empty($vvv['child']))}{volist name="$vvv['child']" id="vvvv"}
            <option value="{$vvvv['id']}">{$v['cat_name']} - {$vv['cat_name']} - {$vvv['cat_name']} - {$vvvv['cat_name']}</option>

            {/volist}{/if}
            {/volist}{/if}
            {/volist}{/if}
            {/volist}
            {/if}
        </select>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label must">商品图片</label>
    <div class="col-sm-8">
        <div class="multi-img-box multi-img-box-thumbs">
            <div class="input-group">
                <input type="text" class="form-control" readonly="readonly" value="" placeholder="选择商品图片" autocomplete="off">
                <span class="input-group-btn">
                    <button class="btn btn-primary btn-select" type="button">选择商品图片</button>
                    <input type="hidden" name="thumbs" id="h_thumbs" value="{model:safe_show field='thumbs' /}">
                </span>
            </div>
            <div class="input-group multi-img-details ui-sortable">
            </div>
        </div>
        <p class="help-block">第一张为缩略图，建议为正方型图片，其他为详情页面图片，尺寸建议宽度为640，并保持图片大小一致</p>
        <span class="help-block">您可以拖动图片改变其显示顺序 </span>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">已出售数（件）</label>
    <div class="col-sm-8 col-xs-12">
        <input type="text" name="sales" id="sales" class="form-control valid" value="{model:safe_show field='sales' /}" style="width:150px;display: inline;margin-right: 20px;">
        <div class="pretty p-default">
            {if(empty($model))}
            <input type="checkbox" name="is_show_sales" class="minimal" value="1">
            {else /}
            <input type="checkbox" name="is_show_sales" class="minimal" value="1" {if(1 == $model['is_show_sales'])}checked{/if}>
            {/if}
            <div class="state p-info-o">
                <label>显示销量</label>
            </div>
        </div>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">上架</label>
    <div class="col-sm-8 col-xs-12">
        {volist name="goodsStatus" id="v"}
        <div class="pretty p-default p-round">
            {if(empty($model))}
            <input type="radio" name="status" class="minimal" value="{$key}" checked>
            {else /}
            <input type="radio" name="status" class="minimal" value="{$key}" {if($model['status'] == $key)}checked{/if}>
            {/if}
            <div class="state p-info-o">
                <label>{$v}</label>
            </div>
        </div>
        {/volist}
        <span class="help-block">赠品上架之后，状态不可更改。</span>
    </div>
</div>